home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / Applet Toolkit / applet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-11  |  9.0 KB  |  471 lines  |  [TEXT/KAHL]

  1.  
  2.  
  3. #define appletinclude /*so other modules can tell if we've been included*/
  4.  
  5.  
  6. #ifndef appletdefsinclude
  7.  
  8.     #include "appletdefs.h"
  9.     
  10. #endif
  11.  
  12.  
  13. #ifndef opsinclude
  14.  
  15.     #include "appletops.h"
  16.     
  17. #endif
  18.  
  19.  
  20. #ifndef cursorinclude
  21.  
  22.     #include "appletcursor.h"
  23.     
  24. #endif
  25.  
  26.  
  27. #ifndef mouseinclude
  28.  
  29.     #include "appletmouse.h"
  30.     
  31. #endif
  32.  
  33.  
  34. #ifndef kbinclude
  35.  
  36.     #include "appletkb.h"
  37.  
  38. #endif
  39.  
  40.  
  41. #ifndef memoryinclude
  42.  
  43.     #include "appletmemory.h"
  44.  
  45. #endif
  46.  
  47.  
  48. #ifndef dialogsinclude
  49.  
  50.     #include "appletdialogs.h"
  51.  
  52. #endif
  53.  
  54.  
  55. #ifndef quickdrawinclude
  56.  
  57.     #include "appletquickdraw.h"
  58.  
  59. #endif
  60.  
  61.  
  62. #ifndef filesinclude
  63.  
  64.     #include "appletfiles.h"
  65.  
  66. #endif
  67.  
  68.  
  69. #ifndef stringsinclude
  70.  
  71.     #include "appletstrings.h"
  72.  
  73. #endif
  74.  
  75.  
  76. #ifndef fontinclude
  77.  
  78.     #include "appletfont.h"
  79.  
  80. #endif
  81.  
  82.  
  83. #ifndef undoinclude
  84.  
  85.     #include "appletundo.h"
  86.  
  87. #endif
  88.  
  89.  
  90. #ifndef frontierinclude
  91.  
  92.     #include "appletfrontier.h"
  93.  
  94. #endif
  95.  
  96.  
  97. #ifndef paletteinclude
  98.  
  99.     #include "appletpalette.h"
  100.  
  101. #endif
  102.  
  103.  
  104. #ifndef __IAC__
  105.  
  106.     #include <iac.h>
  107.     
  108. #endif
  109.  
  110.  
  111. extern EventRecord appletevent; /*the last event received by appletmain.c*/
  112.  
  113.  
  114. typedef struct tyselectioninfo {
  115.     
  116.     boolean fldirty; /*something changed, menus need updating*/
  117.     
  118.     boolean flcansetfont; /*can we set font in current context?*/
  119.     
  120.     boolean flcansetsize; /*can we set size?*/
  121.     
  122.     boolean flcansetstyle; /*can we set style?*/
  123.     
  124.     boolean flcansetjust; /*can we set justification?*/
  125.     
  126.     boolean flcansetleading; /*can we set leading?*/
  127.     
  128.     short fontnum;
  129.     
  130.     short fontsize;
  131.     
  132.     short leading;
  133.     
  134.     boolean flplain;
  135.     
  136.     boolean flshadow;
  137.     
  138.     boolean floutline;
  139.     
  140.     boolean flunderline;
  141.     
  142.     boolean flitalic;
  143.     
  144.     boolean flbold;
  145.     
  146.     boolean flsubscript;
  147.     
  148.     boolean flsuperscript;
  149.     
  150.     boolean flextended; 
  151.     
  152.     boolean flcondensed;
  153.             
  154.     tyjustification justification;
  155.     
  156.     short fontstyle; /*see setselectionstyleinfo*/
  157.     } tyselectioninfo;
  158.     
  159.     
  160. typedef struct tyappwindow {
  161.     
  162.     bigstring fname;
  163.     
  164.     short vnum;
  165.     
  166.     short fnum;
  167.     
  168.     short windowvertpixels, windowhorizpixels;
  169.     
  170.     short defaultfont, defaultsize, defaultstyle;
  171.     
  172.     tyjustification defaultjustification;
  173.     
  174.     short fontheight;
  175.     
  176.     Handle appdata;
  177.     
  178.     Rect windowrect;
  179.     
  180.     Rect contentrect, oldcontentrect;
  181.     
  182.     Rect statusrect; /*the rectangle covering the status portion of window*/
  183.     
  184.     Rect updaterect; /*when an update event is in process, this is the dirty part of the window*/
  185.     
  186.     WindowPtr macwindow;
  187.     
  188.     hdlscrollbar vertbar, horizbar; /*the window's scrollbars*/
  189.     
  190.     boolean flmadechanges;
  191.     
  192.     boolean flresetscrollbars;
  193.     
  194.     boolean flcolorwindow;
  195.     
  196.     boolean flzoomed;
  197.     
  198.     boolean flprinting;
  199.     
  200.     short zoomheight, zoomwidth; /*set by getcontentsizecallback*/
  201.     
  202.     Point scrollorigin;
  203.     
  204.     tyselectioninfo selectioninfo;
  205.     
  206.     short forecolor, backcolor; /*indexes into the color lookup table*/
  207.     
  208.     short originpushdepth; /*see apppushorigin*/
  209.     
  210.     hdlpaletterecord hpalette; /*info about the palette for this window, nil if it has no palette*/
  211.  
  212.     Handle undostack, redostack;
  213.     } tyappwindow, *ptrappwindow, **hdlappwindow;
  214.  
  215.  
  216. #define app1class 'app1'
  217.  
  218. typedef boolean (*tyappcallback) (void);
  219.  
  220. typedef boolean (*tyapphandleptrcallback) (Handle *);
  221.  
  222. typedef boolean (*tyapphandlecallback) (Handle);
  223.  
  224. typedef void (*tyapprectcallback) (Rect);
  225.  
  226. typedef boolean (*tyappbooleancallback) (boolean);
  227.  
  228. typedef boolean (*tyappshortcallback) (short);
  229.  
  230. typedef boolean (*tyappsscrollcallback) (tydirection, boolean, short);
  231.  
  232. typedef boolean (*tymenucallback) (short, short);
  233.  
  234. typedef boolean (*tystringcallback) (bigstring);
  235.  
  236.  
  237.  
  238.  
  239. typedef struct typrintinfo {
  240.     
  241.     Rect paperrect;
  242.     
  243.     short vpagepixels; /*number of pixels on a page, vertically*/
  244.     
  245.     short ctpages; /*the number of pages in the document being printed*/
  246.     
  247.     Handle printhandle; /*a handle to the machine's print record*/
  248.     } typrintinfo;
  249.  
  250.  
  251. typedef struct tyappletrecord {
  252.     
  253.     hdlappwindow appwindow; /*the frontmost applet window, callbacks work on this*/
  254.  
  255.     Handle appdata; /*a handle allocated by the applet to hold its data*/
  256.     
  257.     long filetype, creator; /*file type and creator for file saving*/
  258.     
  259.     sfcallback filefiltercallback; /*determines if files are displayed in stanard file dialog*/
  260.     
  261.     typrintinfo printinfo; /*for coordinating printing between applet and the shell*/
  262.     
  263.     short defaultfont, defaultsize, defaultstyle;
  264.     
  265.     boolean resizeable; /*if true the app's windows can be resized*/
  266.     
  267.     boolean eraseonresize; /*if true, the toolkit erases the window when it's resized*/
  268.     
  269.     boolean horizscroll; /*if true, the applet implements horiz scrolling*/
  270.     
  271.     boolean vertscroll; /*if true, the applet implements vert scrolling*/
  272.     
  273.     boolean haspalette; /*if true, the applet has an icon palette*/
  274.     
  275.     short ctpaletteicons; /*the number of icons in the palette*/
  276.     
  277.     boolean notsaveable; /*if true, the applet doesn't implement saving/opening files*/
  278.     
  279.     short statuspixels; /*height of status bar at top of window*/
  280.     
  281.     boolean usecolor; /*if true, we allocate a color window on color machines*/
  282.     
  283.     boolean exactcolors; /*if true, we use the palette manager to be sure you get exact colors*/
  284.     
  285.     boolean appmanagesfontmenus; /*if true, the toolkit doesn't insert font/size/style sub-menus*/
  286.     
  287.     tyappcallback newrecordcallback; /*allocate and initialize a new data handle*/
  288.     
  289.     tyappcallback disposerecordcallback; /*dealloc a data handle*/
  290.     
  291.     tyappcallback idlecallback; /*set mouse cursor, other "idle" stuff*/
  292.     
  293.     tyappbooleancallback activatecallback; /*activate or deactivate the window data*/
  294.     
  295.     tyappcallback updatecallback; /*update the display of the window data*/
  296.     
  297.     tyappcallback preupdatecallback; /*inval anything that needs inval'ing before an update*/
  298.     
  299.     tyappcallback windowresizecallback; /*recalc display data, adjust to new window size*/
  300.     
  301.     tyappcallback iacmessagecallback; /*process an IAC message*/
  302.     
  303.     tyappcallback iacfastmessagecallback; /*process a system event handler message*/
  304.     
  305.     tyapphandleptrcallback packcallback; /*pack memory structure into a disk handle*/
  306.     
  307.     tyapphandlecallback unpackcallback; /*unpack disk handle into memory structure*/
  308.     
  309.     tyapphandleptrcallback gettextcallback; /*return a handle of unformatted ASCII text*/
  310.     
  311.     tyapphandleptrcallback getpictcallback; /*return a Macintosh PicHandle of selected items*/
  312.     
  313.     tyappsscrollcallback scrollcallback;
  314.     
  315.     tyappcallback scrolltocallback;
  316.     
  317.     tyappcallback pagesetupcallback;
  318.     
  319.     tyappcallback openprintcallback;
  320.     
  321.     tyappshortcallback printpagecallback;
  322.     
  323.     tyappcallback closeprintcallback;
  324.     
  325.     tyapphandlecallback puttextcallback;
  326.     
  327.     tyapphandlecallback putpictcallback;
  328.     
  329.     tyappcallback haveselectioncallback;
  330.     
  331.     tyappcallback selectallcallback;
  332.     
  333.     tyappcallback keystrokecallback;
  334.     
  335.     tyappcallback mousecallback;
  336.     
  337.     tyappcallback mouseinstatuscallback;
  338.     
  339.     tyappcallback updatestatuscallback;
  340.     
  341.     tymenucallback menucallback;
  342.     
  343.     tyappcallback insertmenucallback;
  344.     
  345.     tyappcallback setselectioninfocallback;
  346.     
  347.     tyappcallback setfontcallback;
  348.     
  349.     tyappcallback setsizecallback;
  350.     
  351.     tyappcallback setstylecallback;
  352.     
  353.     tyappcallback setjustifycallback;
  354.     
  355.     tyapphandleptrcallback copycallback; 
  356.     
  357.     tyappcallback clearcallback;
  358.     
  359.     tyapphandlecallback pastecallback;
  360.     
  361.     tyappcallback initmacintoshcallback;
  362.     
  363.     tyappbooleancallback resumecallback; /*suspend or resume the window*/
  364.     
  365.     tyapprectcallback eraserectcallback; /*color apps may want to override the default routine*/
  366.     
  367.     tyappcallback getcontentsizecallback; /*for apps that want to be smart about zooming*/
  368.     
  369.     tystringcallback opendoccallback; /*allow app to override 'odoc' Apple Event*/
  370.             
  371.     tyappcallback setglobalscallback; /*app can copy from app.appdata to its own globals*/
  372.     
  373.     tyapphandleptrcallback getoptionscallback;
  374.     
  375.     tyapphandlecallback putoptionscallback;
  376.     } tyappletrecord, *ptrappletrecord, **hdlappletrecord;
  377.     
  378.     
  379. extern tyappletrecord app; /*global applet record, short name for easy access*/
  380.  
  381.  
  382.  
  383. #ifndef scrollbarinclude
  384.  
  385.     #include "appletscrollbar.h"
  386.  
  387. #endif
  388.  
  389.  
  390.  
  391. void getdesktoprect (hdlappwindow, Rect *);
  392.  
  393. boolean apppushwindow (hdlappwindow);
  394.  
  395. boolean apppopwindow (void);
  396.  
  397. boolean apppushorigin (void);
  398.  
  399. boolean apppoporigin (void);
  400.  
  401. boolean appopenbitmap (Rect, hdlappwindow);
  402.  
  403. boolean appclosebitmap (hdlappwindow);
  404.  
  405. boolean apppushclip (Rect r);
  406.  
  407. boolean apppopclip (void);
  408.  
  409. void appprecallback (void);
  410.  
  411. void apppostcallback (void);
  412.  
  413. boolean newappwindow (bigstring, boolean);
  414.  
  415. void invalappwindow (hdlappwindow, boolean);
  416.  
  417. void updateappwindow (hdlappwindow);
  418.  
  419. void moveappwindow (hdlappwindow, Rect);
  420.  
  421. boolean findbywindowtitle (bigstring, hdlappwindow *);
  422.  
  423. boolean findnthwindow (short, hdlappwindow *);
  424.  
  425. short countwindows (void);
  426.  
  427. boolean findbyfile (bigstring, short, hdlappwindow *);
  428.  
  429. boolean settargetglobals (void);
  430.  
  431. boolean appalert (bigstring);
  432.  
  433. boolean appconfirm (bigstring);
  434.  
  435. boolean appask (bigstring, bigstring);
  436.  
  437. void appletinitmanagers (void);
  438.  
  439. void runapplet (void);
  440.  
  441. boolean exitmainloop (void);
  442.  
  443. boolean closefrontwindow (void);
  444.  
  445. boolean initprint (void);
  446.  
  447. boolean pagesetup (void);
  448.  
  449. boolean printappwindow (hdlappwindow, boolean);
  450.  
  451. boolean getprintinfo (void);
  452.  
  453. pascal Boolean appscriptcomplete (void); /*call this when a script completes*/
  454.  
  455. boolean visitappwindows (boolean  (*) ());
  456.  
  457. boolean invalallwindows (void);
  458.  
  459. boolean eraseallwindows (void);
  460.  
  461. void setappwindow (hdlappwindow);
  462.  
  463. void apperaserect (Rect);
  464.  
  465. boolean apprectneedsupdate (Rect);
  466.  
  467. void appinvalstatusseparator (void);
  468.  
  469. void drawappgrowicon (hdlappwindow);
  470.  
  471.